1. Field
The following relates generally to ray tracing systems that can be used, for example, in rendering 2-D representations of 3-D scenes, and more specifically to improvements in approaches for testing rays for intersection with surfaces (“intersection testing”).
2. Related Art
Rendering photo-realistic 2-D images from 3-D scene descriptions with ray tracing is well-known in the computer graphics arts. Ray tracing usually involves obtaining a scene description composed of geometric shapes, which describe surfaces of structures in the scene, and can be called primitives. A common primitive shape is a triangle.
Virtual rays of light are traced into the scene from a view point (“a camera”); each ray is issued to travel through a respective pixel of the 2-D representation, on which that ray can have an effect. The rays are tested for intersection with scene primitives to identify a closest intersected primitive for each ray, if any.
After identifying an intersection for a given ray, a shader associated with that primitive determines what happens next. For example, if the primitive is part of a mirror, then a reflection ray is issued to determine whether light is hitting the intersected point from a luminaire, or in more complicated situations, subsurface reflection, and scattering can be modeled, which may cause issuance of different rays to be intersection tested. By further example, if a surface of an object were rough, not smooth, then a shader for that object may issue rays to model a diffuse reflection on that surface. As such, finding an intersection between a ray and a primitive is a step in determining whether and what kind of light energy may reach a pixel by virtue of a given ray.
When a primitive has been found to be intersected by a ray, and the shader for that intersection is to be executed, an intersection point of the ray is defined based on where the intersection on the primitive was found. This intersection point can serve as the origin for child rays that a shader may cast when shading this intersection. Improvements in algorithms to detect valid intersections between rays and surfaces remain desirable.